<template>
  <div class="priceQs">
    <priceQsbar></priceQsbar>
    <div class="inforBox bgw" style="padding:0.3rem 0rem 0 0.3rem">
      <div class="bxo1" :class="priceObj.flag">
        <p class="num">{{priceObj.price}}</p>
        <p class="qs">
          <span>{{priceObj.gain}}</span>
          <span>{{priceObj.per}}</span>
        </p>
        <p class="priceQj" v-if="!priceQj">{{priceObj.minPrice}}~{{priceObj.maxPrice}}</p>
      </div>
      <div class="bxo2">
        <p class="p1">当前时间：{{priceObj.inputdate}}</p>
        <p class="p2">
          <span class="span1">
            
            {{pricetext}}
            <i
               
            >{{priceObj.oldPrice}}</i>
          </span>
          <span class="span2" v-if="!priceQj">({{priceObj.oldMinPrice}}~{{priceObj.oldMaxPrice}})</span>
        </p>
        <p class="p1"> <span>备注：{{priceObj.remark}}</span></p>
      </div>
    </div>
    <div class="bgw" style="padding:0.1rem 0.3rem;">
      <p class="dw">
        <span>单位：{{priceObj.unit}}</span>
       
      </p>
      <div   class="sydom">
            <img id="syImg" src="../../assets/img/sy.png" alt />
          </div>
      <echart></echart>
    </div>

    <partmorennews :list="list" style=" padding :0.3rem;margin-top:.3rem"></partmorennews>
  </div>
</template>

<script>
import echart from "../../components/ehacrt.vue";
import partmorennews from "../../components/newslist/priceQslist";
import priceQsbar from "../../components/nav/priceQsbar";
import { searchinfolist } from "../../api/sort";
export default {
  components: {
    echart,
    partmorennews,
    priceQsbar
  },
  data() {
    return {
      titleConfig: { title: "热门文章" },
      priceObj: this.$route.query,
      list: [],
        priceQj: this.$route.query.channel === "dlg" ?  true : false,
          pricetext: this.$route.query.channel === "dlg" ?  "昨日价格：" : "昨价："
    };
  },
  methods: {
    getHot() {
      let obj = {};
      obj.channel = this.$route.query.channel;
      obj.kw = this.$route.query.kw;
      obj.limit = 5;
      searchinfolist(obj).then(res => {
        if (res.code == "0000") {
          this.list = res.data;
        }
      });
    }
  },
  created() {
    this.getHot();
  }
};
</script>

<style scoped lang='less'>
.priceQs {
  width: 100%;
  min-height: 100%;
}
.normal {
  color: rgba(110, 111, 117, 1) !important;
}
.down {
  color: rgba(55, 161, 12, 1) !important;
}
.up {
  color: rgba(212, 44, 38, 1) !important;
}
.bgw {
  background: #ffffff;
  position: relative;
  .sydom {
      position: absolute;
      bottom: 2.4rem;
      left: 50%;
      margin-left: -1rem;
      z-index: 11;
      width: 2rem;
      
        opacity:1;
      
    }
}
.inforBox {
  display: flex;
  justify-content: space-between;

  .bxo1 {
      display: flex;
   flex-direction: column;
   justify-content: center;
    .num {
      font-size: 0.6rem;
      margin-bottom: 0.1rem;
    }
    .qs {
      font-size: 0.26rem;
      display: flex;
      justify-content: space-between;
      margin-bottom: 0.1rem;
      span {
        margin-right: 0.4rem;
      }
    }
    .priceQj {
      color: rgba(39, 41, 55, 0.6);
      margin-bottom: 0.1rem;
    }
  }
  .bxo2 {
    color: rgba(110, 111, 117, 1);
    padding-right:.3rem; 
    background: linear-gradient(
      90deg,
      rgba(253, 253, 253, 0) 0%,
      rgba(251, 243, 232, 1) 100%
    );
    .p1,.p2 {
      margin:  0.22rem 0;
    }

  
    .span2 {
       
      color: rgba(39, 41, 55, 0.6);
      font-size: 0.2rem;
    }
    
  }
}

.dw {
  width: 7rem;
  color: rgba(110, 111, 117, 1);
  position: absolute;
  top: 0.15rem;
  display: flex;
  justify-content: space-between;
}
</style>